import { get, post } from '@/utils/request'

//添加文章
export async function checkLogin(checkLogin) {
    //console.log(checkLogin)
    let [response, error] = await post(`/admin/checkLogin`,checkLogin)
    //console.log(response)
    return response !== null ? response : error
}    

//添加文章
export async function insterArticle(addArticle) {
    let [response, error] = await post(`/admin/addArticle`,addArticle)
    //console.log(response)
    return response !== null ? response : error
}    

//修改文章
export async function updateArticle(updateArt) {
    let [response, error] = await post(`/admin/updateArticle`,{...updateArt})
    //console.log(response)
    return response !== null ? response : error
} 

//删除留言
export async function delMes(email) {
    let [response, error] = await post(`/admin/delMsg/${email}`)
    //console.log(response)
    return response !== null ? response : error
}
//删除文章
export async function delArticle(article_id) {
    //console.log(article_id)
    let [response, error] = await post(`/admin/delArticle/${article_id}`)
    //console.log(response)
    return response !== null ? response : error
}